Skip to content

fix: include complementary ARIA landmarks in auto-scoped snapshots#64

Merged
avifenesh merged 3 commits intomainfrom
fix/snapshot-repo-stats-26
Feb 24, 2026
Merged

fix: include complementary ARIA landmarks in auto-scoped snapshots#64
avifenesh merged 3 commits intomainfrom
fix/snapshot-repo-stats-26

Conversation

@avifenesh
Copy link
Collaborator

Summary

  • Auto-scoped snapshots now include adjacent complementary ARIA landmarks (<aside>, [role="complementary"]) alongside <main>, capturing sidebar content like repository stats that was previously excluded
  • Uses a virtual locator pattern that concatenates ariaSnapshot() from main and up to 3 complementary siblings
  • Complementary detection is wrapped in its own try-catch so failures fall back to main-only (not body)
  • ariaSnapshot() calls for complementary regions are parallelized via Promise.all

Test Plan

  • 13 new tests covering: complementary detection, cap at 3, error handling, body fallback, pipeline integration, option isolation
  • All 456 tests pass (up from 443 baseline)
  • Source assertion guards sync between web-ctl.js and test replica

Related Issues

Closes #26

detectMainContent now captures adjacent aside and [role="complementary"]
siblings when a main landmark is found, returning a virtual locator that
concatenates all region snapshots. This surfaces sidebar content like
repository stats without requiring manual scoping. Complementary regions
are capped at 3 and failures are silently skipped.
Wrap complementary landmark detection in its own try-catch so failures
return mainLocator instead of falling back to body. Parallelize
ariaSnapshot calls using Promise.all. Add tests for compLocator.count()
throwing and all-complementary-fail scenarios.
@avifenesh avifenesh merged commit 761c7c2 into main Feb 24, 2026
2 of 3 checks passed
@avifenesh avifenesh deleted the fix/snapshot-repo-stats-26 branch February 24, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility tree snapshot missing repo stats bar (stars, forks, watchers)

1 participant